// src/router/index.ts
import {createRouter, createWebHistory} from 'vue-router';
import Home from '../views/Home.vue';
import Login from '../views/Login.vue';
import PostDetail from '../views/Post.vue';
import Register from "../views/Register.vue";
import NewPost from "@/views/NewCreate/NewPosts.vue";
import Settings from "../views/Settings.vue";
import HomeIndex from "../views/HomeIndex.vue";
import About from "../views/About.vue";
import NewCanteenShop from "@/views/NewCreate/NewCanteenShop.vue";
import CurrentUser from "../views/CurrentUser.vue";
import RecentlyEdited from "../views/Edit/RecentlyEdited.vue";
import CanteenShopDetail from "../views/Detail/CanteenShopDetail.vue";
import TeachingBuildingSelect from "../views/PageSelect/TeachingBuildingSelect.vue";
import EditCanteenShop from "@/views/Edit/EditCanteenShop.vue";
import NewTeachingBuildingContent from "../views/NewCreate/NewTeachingBuildingContent.vue";
import TeachingBuildingDetail from "@/views/Detail/TeachingBuildingDetail.vue";
import NewMaimaiChunithmContent from "@/views/NewCreate/NewMaimaiChunithmContent.vue";
import NewPlaygroundContent from "@/views/NewCreate/NewPlaygroundContent.vue";
import EditTeachingBuilding from "@/views/Edit/EditTeachingBuilding.vue";
import MaimaiChunithmSelect from "@/views/PageSelect/MaimaiChunithmSelect.vue";
import CanteenShopSelect from "@/views/PageSelect/CanteenShopSelect.vue";
import MaimaiChunithmDetail from "@/views/Detail/MaimaiChunithmDetail.vue";
import PlaygroundSelect from "@/views/PageSelect/PlaygroundSelect.vue";
import PlaygroundDetail from "@/views/Detail/PlaygroundDetail.vue";
import EditPlayground from "@/views/Edit/EditPlayground.vue";
import EditMaimaiChunithm from "@/views/Edit/EditMaimaiChunithm.vue";
import Advice from "@/views/Advice.vue";
import Announcement from "@/views/Announcement.vue";
import Chat from "@/views/Chat/Chat.vue";
import ChatWithAI from "@/views/Chat/ChatWithAI.vue";
//配置路由

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home',
        },
        {
            path: '/user/login',
            name: 'Login',
            component: Login,
        },
        {
            path: '/user/home',
            name: 'Home',
            redirect: '/home',
            component: Home,
            children:
                [
                    {
                        path: '/newCanteenShop',
                        component: NewCanteenShop,
                    },
                    {
                        path: '/newMaimaiChunithmContent',
                        component: NewMaimaiChunithmContent,
                    },
                    {
                        path: '/newPlaygroundContent',
                        component: NewPlaygroundContent,
                    },
                    {
                        path: '/newTeachingBuildingContent',
                        component: NewTeachingBuildingContent,
                    },
                    {
                        path: '/teachingBuildingDetail',
                        component: TeachingBuildingDetail,
                    },
                    {
                        path: '/editCanteenShop',
                        component: EditCanteenShop,
                    },
                    {
                        path: '/editTeachingBuilding',
                        component: EditTeachingBuilding,
                    },
                    {
                        path: '/editPlayground',
                        component: EditPlayground,
                    },
                    {
                        path: '/editMaimaiChunithm',
                        component: EditMaimaiChunithm,
                    },
                    {
                        path: '/newpost',
                        component: NewPost,
                    },
                    {
                        path: '/settings',
                        component: Settings,
                    },
                    {
                        path: '/home',
                        component: HomeIndex,
                    },
                    {
                        path: '/about',
                        component: About,
                    },
                    {
                        path: '/advice',
                        component: Advice,
                    },
                    {
                        path: '/announcement',
                        component: Announcement,
                    },
                    {
                        path: '/currentUser',
                        component: CurrentUser,
                    },
                    {
                        path: '/recentEdit',
                        component: RecentlyEdited,
                    },
                    {
                        path: '/canteenShopDetail',
                        component: CanteenShopDetail,
                    },
                    {
                        path: '/MaimaiChunithmDetail',
                        component: MaimaiChunithmDetail,
                    },
                    {
                        path: '/PlaygroundDetail',
                        component: PlaygroundDetail,
                    },
                    {
                        path: '/teachingBuildingSelect',
                        component: TeachingBuildingSelect,
                    },
                    {
                        path: '/MaimaiChunithmSelect',
                        component: MaimaiChunithmSelect,
                    },
                    {
                        path: '/canteenShopSelect',
                        component: CanteenShopSelect,
                    },
                    {
                        path: '/PlaygroundSelect',
                        component: PlaygroundSelect,
                    },
                    {
                        path: '/onlineChat',
                        component: Chat,
                    },
                    {
                        path: '/chatWithAI',
                        component: ChatWithAI,
                    },
                    {
                        path: '/register',
                        name: 'Register',
                        component: Register,
                    },
                ],
        },
        {
            path: '/post/:id',
            component: PostDetail,
        },

    ]
});

export default router;